#ifndef KMNETCLIENT_H
#define KMNETCLIENT_H
#include <string>
#include "enet/enet.h"
#include "KMNetMsgIn.h"
#include "KMNetMsgOut.h"

class KMNetClient
{
public:
    KMNetClient();
    virtual ~KMNetClient();
    bool connectToServer(const std::string &address,unsigned int port);
    void disconnect();
    bool isConnected() const;
    void send(const KMNetMsgOut &msg, bool reliable = true,
              unsigned char channel = 0x00);
    void update();
protected:
    virtual void processMessageFromServer(KMNetMsgIn &msg) = 0;
private:
    ENetPeer *mPeer;
    ENetHost *mHost;
};

#endif
